package com.github.androiddevelopmentframework.script.activity;

import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.github.androiddevelopmentframework.R;
import com.github.androiddevelopmentframework.script.bean.UserInfo;
import com.github.androiddevelopmentframework.script.mvpInterface.ScriptInterface;
import com.github.androiddevelopmentframework.script.presenter.ScriptPresenter;
import com.github.freewu.mvp.presenter.Presenter;
import com.github.freewu.mvp.view.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by free on 2017/1/16 0016.
 */
public class ScriptActivity extends BaseActivity implements ScriptInterface.ViewInterface{
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.sex)
    TextView sex;
    @BindView(R.id.email)
    TextView email;
    @BindView(R.id.headImage)
    ImageView headImage;

    private ScriptPresenter presenter;

    @Override
    public int getLayout() {
        return R.layout.activity_script;
    }

    @Override
    public void initView(View mView) {
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        presenter=new ScriptPresenter(this);

        addPresenter(presenter);
    }

    @Override
    public void setUserInfo(UserInfo userInfo) {
        name.setText(userInfo.getName());
        if (userInfo.getSex()==1){
            sex.setText("男");
        }else{
            sex.setText("女");
        }
        email.setText(userInfo.getEmail());

    }
}
